package cn.gp.mapper;

import cn.gp.entity.Consumer;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ClassName ConsumerMapper
 * @Description TODO
 * @Author He_Guoping
 * @Date 2023/5/28 13:02
 * @Version 1.0
 */
@Mapper
public interface ConsumerMapper {

//    @Select("select * from consumer")
    List<Consumer> list(String name);

    @Insert("insert into consumer(name, sex, phone) values(#{name}, #{sex}, #{phone});")
    void save(Consumer consumer);

    @Delete("delete from consumer where id = #{id};")
    void deleteById(Integer id);

    void update(Consumer consumer);
}
